home *** CD-ROM | disk | FTP | other *** search
/ Delphi 5 for Professionals / DELPHI5.iso / AddOns / Components / TEECHART / Delphi1_And_Delphi2 / EXAMPLES / OTHER / Printing better / UPRINTPR.PAS < prev   
Encoding:
Pascal/Delphi Source File  |  1998-10-24  |  1.7 KB  |  70 lines

  1. unit Uprintpr;
  2.  
  3. interface
  4.  
  5. { This example shows the different on using Proportional printing or not }
  6. uses
  7.   WinProcs,WinTypes, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  8.   ExtCtrls, TeeProcs, TeEngine, Chart, DBChart, StdCtrls, Series;
  9.  
  10. type
  11.   TForm1 = class(TForm)
  12.     Button1: TButton;
  13.     Button2: TButton;
  14.     Button3: TButton;
  15.     Label1: TLabel;
  16.     Label2: TLabel;
  17.     Chart1: TChart;
  18.     Series1: TBarSeries;
  19.     procedure Button1Click(Sender: TObject);
  20.     procedure FormCreate(Sender: TObject);
  21.     procedure Button2Click(Sender: TObject);
  22.     procedure Button3Click(Sender: TObject);
  23.   private
  24.     { Private declarations }
  25.   public
  26.     { Public declarations }
  27.   end;
  28.  
  29. var
  30.   Form1: TForm1;
  31.  
  32. implementation
  33.  
  34. {$R *.DFM}
  35. uses TeePrevi;
  36.  
  37. procedure TForm1.Button1Click(Sender: TObject);
  38. begin
  39.   Chart1.PrintProportional:=True;
  40.   ChartPreview(Self,Chart1);
  41. end;
  42.  
  43. procedure TForm1.FormCreate(Sender: TObject);
  44. begin
  45.   { Warning to 32-bit users }
  46.   Series1.FillSampleValues(8);
  47.   {$IFNDEF WIN32}
  48.   ShowMessage('Warning: Metafiles and printing work much better'+#13+
  49.               'in Windows 32-bit (Windows 95 or NT)');
  50.   {$ELSE}
  51.   ShowMessage('Warning: This example is intended for Delphi 1.0 16-bit'+#13+
  52.               'or for problems with 32-bit printer drivers'+#13+#13+
  53.               'It might work fine on your system configuration.');
  54.   {$ENDIF}
  55. end;
  56.  
  57. procedure TForm1.Button2Click(Sender: TObject);
  58. begin
  59.   Chart1.PrintProportional:=False;
  60.   Chart1.PrintMargins:=Rect(15,15,15,15); { default margins }
  61.   ChartPreview(Self,Chart1);
  62. end;
  63.  
  64. procedure TForm1.Button3Click(Sender: TObject);
  65. begin
  66.   Close;
  67. end;
  68.  
  69. end.
  70.